class Teaching < ActiveRecord::Base
  belongs_to :event
  belongs_to :instructor

  # This method returns the concatnation of name and, if they're available, effectiveness/usefulness.
  def name_stat
    if usefulness and effectiveness
      myUsefulness = ((usefulness * 100).to_i)/100.0
      myEffectiveness = ((effectiveness*100).to_i)/100.0
      return instructor.name + ", effectiveness: #{myEffectiveness}, usefulness: #{myUsefulness}"
    else
      return instructor.name
    end
  end

end
